package ezXpns.GUI.controllers;


/**
 * @author A0086931X
 */

//@author A0086931X
public class RequestResult {	
	private RequestResult(boolean accepted, String error){
		this.accepted = accepted;
		errorText = error;
	}
	
	public static RequestResult accept() {
		return ACCEPTED;
	}
	
	public static RequestResult reject(String error) {
		return new RequestResult(false, error);
	}
	
	//whether the request is accepted
	public boolean isAccepted(){
		return accepted;
	}
	
	//error message if any
	public String getError(){
		return errorText;
	}

	private static final RequestResult ACCEPTED = new RequestResult(true, null);
	
	private boolean accepted;
	private String errorText;	
}